package com.kmxd.ams.client.oss;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kmxd.ams.client.oss.dto.OssAttachmentQueryDTO;
import com.kmxd.ams.client.oss.dto.OssAttachmentUploadDTO;
import com.kmxd.ams.client.oss.vo.OssAttachmentListVO;
import com.kmxd.ams.client.oss.vo.OssAttachmentVO;
import com.kmxd.ams.infra.oss.entity.OssAttachment;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;

/**
 * 公共附件表 服务类
 *
 * @author ZuoLG
 * @since 2022-07-25
 */
public interface IOssAttachmentSvc extends IService<OssAttachment> {

  /**
   * 分页查询
   *
   * @param reqPage
   * @param req
   * @return
   */
  Page<OssAttachmentListVO> selectPage(Page reqPage, OssAttachmentQueryDTO req);

  /**
   * 查询列表
   *
   * @param req
   * @return
   */
  List<OssAttachmentListVO> selectList(OssAttachmentQueryDTO req);

  /**
   * 查询当前未转换数据，此方法针对转换定时任务
   *
   * @param req
   * @return
   */
  List<OssAttachmentListVO> selectListByDay(OssAttachmentQueryDTO req);

  /**
   * 文件上传
   *
   * @param file
   * @return
   * @throws Exception
   */
  OssAttachmentVO upload(MultipartFile file) throws Exception;

  OssAttachmentVO upload(MultipartFile file, OssAttachmentUploadDTO req) throws Exception;

  /**
   * 删除
   *
   * @param ids
   */
  void remove(String ids);

  /**
   * 查看
   *
   * @param id
   * @return
   */
  OssAttachmentVO view(Long id);

  /**
   * 文件下载
   *
   * @param id
   * @return
   */
  OssAttachmentVO download(Long id);

  OssAttachmentVO preview(Long id);
}
